import { defineStore } from 'pinia'

export interface UserInfoType {
  id: number
  userName: string
  password?: string
  account: string
  avatar: string
  createTime: string
  gender: 0 | 1 | 2
  mobile: string
  access_token?: string
}
export const useUserStore = defineStore('user', {
  state: (): { userInfo: UserInfoType | null } => ({
    userInfo: null
  }),
  getters: {
    getUserInfo: state => state.userInfo
  },
  actions: {
    setUserInfo(userInfo: UserInfoType) {
      this.userInfo = userInfo
    }
  }
})
